<template>
  <div class="absolute right-0 top-0 bottom-0 bg-white w-96 overflow-y-auto">
    <div class="p-2 flex justify-between items-center bg-gray-200 shadow border text-cyan-500">
      <span>
        <FileDoneOutlined />
        我的任务</span
      >
      <span class="text-xs cursor-pointer" @click="$router.push('/data/alarm')">更多>></span>
    </div>
    <a-list size="" bordered :data-source="list">
      <template #renderItem="{ item }">
        <a-list-item>
          <div class="flex justify-between w-full text-gray-600">
            <span>{{ item.time }}</span>
            <span>{{ item.days }}</span>
            <a-checkbox v-model:checked="item.checked"></a-checkbox>
          </div>
        </a-list-item>
      </template>
    </a-list>
  </div>
</template>

<script>
import { FileDoneOutlined } from '@ant-design/icons-vue';
import { defHttp } from '/@/utils/http/axios';

export default {
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.fetch();
  },
  methods: {
    fetch() {
      defHttp.get({ url: '/Dashbord/get-warn' }).then((res) => {
        this.list = res.data.map((item) => {
          return {
            time: item.createDate.slice(0, 10),
            days: item.warnStr,
            check: false,
          };
        });
      });
    },
  },
};
</script>
  